import request from '@/utils/request'

const api = {
  listStorage: '/storage/list'
}

export function listStorage (query) {
  return request({
    url: api.listStorage,
    method: 'get',
    params: query
  })
}

export function createStorage (data) {
  return request({
    url: '/storage/create',
    method: 'post',
    data
  })
}

export function readStorage (data) {
  return request({
    url: '/storage/read',
    method: 'get',
    data
  })
}

export function updateStorage (data) {
  return request({
    url: '/storage/update',
    method: 'post',
    data
  })
}

export function deleteStorage (data) {
  return request({
    url: '/storage/delete',
    method: 'post',
    data
  })
}

const uploadPath = process.env.VUE_APP_API_BASE_URL + '/storage/create'
export { uploadPath }
